<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('勘察成果审查')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <p>关键字：</p>
                                <input type="text" name="keyword"/>
                            </li>
                            <li>
							项目类型：<select name="projectType" th:with="type=${@dict.getType('sys_normal_disable')}">
							            <option value="">全部</option>
										<option value="房建">房建</option>
										<option value="市政">市政</option>
								   </select>
							</li>
							<li>
							审查状态：<select name="role" th:with="type=${@dict.getType('sys_normal_disable')}">
							            <option value="">全部</option>
										<option value="上报">已上报</option>
										<option value="程序性审查退回">程序性审查退回</option>
										<option value="程序性审查通过">程序性审查通过</option>
										<option value="指定审查人员">指定审查人员</option>
										<option value="审查人员初审">审查人员初审</option>
										<option value="技术负责人审查退回">技术负责人审查退回</option>
										<option value="技术性整改上报">技术性整改上报</option>
										<option value="审查人员复审">审查人员复审</option>
										<option value="技术负责人审查通过">技术负责人审查通过</option>
								   </select>
							</li>
							<li class="select-time">
                                <p>审查日期：</p>
                                <input type="text" class="time-input" id="startTime2" placeholder="开始时间" name="beginAcceptedYear"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime2" placeholder="结束时间" name="endAcceptedYear"/>
                            </li> 
                            <li class="select-time">
                                <p>上报日期：</p>
                                <input type="text" class="time-input" id="startTime1" placeholder="开始时间" name="beginReportDate"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime1" placeholder="结束时间" name="endReportDate"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                 <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:src="@{/js/plugins/datetime/moment.js}"></script>
    <script th:inline="javascript">
    var applyFlag = [[${@permission.hasPermi('surResult:surResult:apply')}]];
	var logFlag = [[${@permission.hasPermi('surResult:surResult:log')}]];
	var certFlag = [[${@permission.hasPermi('surResult:surResult:cert')}]];
    
    var prefix = ctx + "surResult/surResult";
    var enterPriseprefix = ctx + "enterprise/enterprise";
    var projectArchivesPrefix = ctx + "projectArchives/projectArchives";
    
    $(function() {
    	 var options = {
    			url: prefix + "/list",
                updateUrl: prefix + "/edit/{id}",
                exportUrl: prefix + "/export",
                detailUrl: prefix + "/detail/{id}",
                detailOneUrl: prefix + "/certificateTable/{id}",
                detailTwoUrl: enterPriseprefix + "/detail/{id}",
                detailThreeUrl: projectArchivesPrefix + "/detail/{id}",
                detailFourUrl: enterPriseprefix + "/bulidUnitDetail/{id}",
                detailFiveUrl: prefix + "/surResultJournal/{id}",
                modalName: "勘察成果审查",
                columns: [{
                        field: 'id',
                        title: '序号',
						formatter: function (value, row, index) {
						
						    return index + 1;
						}
                    },
                    {
                        field: 'guid',
                        title: '勘察成果id',
						visible: false
	                }, 
					{
                        field: 'taskName',
                        title: '勘察成果审查工程名'
                    },
					{
                        field: 'projectGuid',
                        title: '项目标识符',
						visible: false
	                },
					{
                        field: 'projectName',
                        title: '所属项目',
                        formatter: function (value, row, index) {
                            var actions = [];
							if(row.projectGuid != null && row.projectGuid != ''){
								actions.push('<a href="javascript:void(0)" onclick="$.operate.detailTabRewriteThree(\'' + value + '\',\''+ row.projectGuid +'\')">'+value+'</a> ');
							}
                            return actions.join('');
                        }
	                },
                    {
                        field: 'buildGuid',
                        title: '建设单位标示符',
						visible: false
                    },
                    {
                        field: 'buildName',
                        title: '建设单位',
                        formatter: function (value, row, index) {
                            var actions = [];
							if(row.buildGuid != null && row.buildGuid != ''){
								actions.push('<a href="javascript:void(0)" onclick="$.operate.detailTabRewriteFour(\'' + row.buildName + '\',\''+ row.buildGuid +'\')">'+value+'</a> ');
							}
                            return actions.join('');
	                    }
                    },
					{	
                        field: 'prospectUnitGuid',
                        title: '勘察单位标识符',
						visible: false
                    },
                    {
                        field: 'prospectUnitName',
                        title: '勘察单位名称',
                        formatter: function (value, row, index) {
                            var actions = [];
							if(row.prospectUnitGuid != null && row.prospectUnitGuid != ''){
								actions.push('<a href="javascript:void(0)" onclick="$.operate.detailTabRewriteTwo(\'' + row.prospectUnitName + '\',\''+ row.prospectUnitGuid +'\')">'+value+'</a> ');
							}
                            return actions.join('');
	                    }
                    },
					{
                        field: 'reviewUnitGuid',
                        title: '审查机构标识符',
						visible: false
                    },
                    {
                        field: 'reviewUnitName',
                        title: '审查机构名称',
                        formatter: function (value, row, index) {
                            var actions = [];
							if(row.reviewUnitGuid != null && row.reviewUnitGuid != ''){
								actions.push('<a href="javascript:void(0)" onclick="$.operate.detailTabRewriteTwo(\'' + row.reviewUnitName + '\',\''+ row.reviewUnitGuid +'\')">'+value+'</a> ');
							}
                            return actions.join('');
	                    }
                    },
                    {
                        field: 'role',
                        title: '当前状态'
                    },
                    {
                        field: 'acceptedYear',
                        title: '审查日期',
						formatter: function (value, row, index) {
							if(value == '' || value == null){
								return value;
							}else{
								return moment(value).format('YYYY-MM-DD');	
							}
						},
						visible: false
	                },
					{
                        field: 'reportDate',
                        title: '上报日期',
						width: 80,
						formatter: function (value, row, index) {
							if(value == '' || value == null){
								return value;
							}else{
								return moment(value).format('YYYY-MM-DD');	
							}
						}
	                },
                    {
	                    field: 'opera',
	                    title: '功能区',
                        formatter: function (value, row, index) {
                            var actions = [];
                            actions.push('<a class="btn btn-success btn-xs ' + applyFlag + '" href="javascript:void(0)" onclick="$.operate.detailQYTabRewrite(\'' + row.guid + '\',\''+ row.taskName +'勘察成果申请表\')"><i class="fa fa-edit"></i>申请表</a> ');
							actions.push('<a class="btn btn-success btn-xs ' + logFlag + '" href="javascript:void(0)" onclick="$.operate.detailTabRewriteFive(\'' + "日志" + '\',\'' + row.guid + '\')"><i class="fa fa-edit"></i>日志</a> ');
							actions.push('<a class="btn btn-success btn-xs ' + certFlag + '" href="javascript:void(0)" onclick="$.operate.detailTabRewriteOne(\'' + "勘察合格书编辑日志" + '\',\'' + row.guid + '\')"><i class="fa fa-edit"></i>合格书</a> ');
                            return actions.join('');
	                       }
	                }]
        };
    	$.table.init(options);
    });
    </script>
</body>
</html>